package com.zzxy.spring3.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspectJ {
    public void myBefore(JoinPoint joinPoint){
        System.out.println("before method : " + joinPoint.getSignature().getName());
        System.out.println("my before ...");
    }
    public void myAfter(JoinPoint joinPoint){
        System.out.println("after method : " + joinPoint.getSignature().getName());
        System.out.println("my after ...");
    }
    public Object myAround(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("before aroudn : ");
        Object obj = pjp.proceed();
        System.out.println("after around :");
        return obj;
    }
    public void myAfterReturning(JoinPoint joinPoint, Object ret) {
        System.out.println("after returning method : " + joinPoint.getSignature().getName() + "- return :" + ret);
    }
    public void myThrowing(JoinPoint joinPoint,Throwable e) {
        System.out.println("my throwing " + e.getMessage());
    }
}
